package com.forum.module.blog.dal.dataobject.notification;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.forum.framework.mybatis.core.dataobject.BaseDO;

import java.util.Objects;

/**
 * 功能:
 * 作者:ouyzh
 * 日期:2025/3/2 18:15
 */
@TableName(value = "blog_notification")
public class NotificationDO extends BaseDO {
    /**
     * 编号
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 接收者编号
     */
    private Long userId;

    /**
     * 通知类型（1：评论 2：点赞 3：关注）
     */
    private Integer type;

    /**
     * 通知内容
     */
    private String content;

    /**
     * 状态（0：未读 1：已读）
     */
    private Integer status;

    public NotificationDO() {
    }

    public NotificationDO(Long id, Long userId, Integer type, String content, Integer status) {
        this.id = id;
        this.userId = userId;
        this.type = type;
        this.content = content;
        this.status = status;
    }

    public Long getId() {
        return id;
    }

    public NotificationDO setId(Long id) {
        this.id = id;
        return this;
    }

    public Long getUserId() {
        return userId;
    }

    public NotificationDO setUserId(Long userId) {
        this.userId = userId;
        return this;
    }

    public Integer getType() {
        return type;
    }

    public NotificationDO setType(Integer type) {
        this.type = type;
        return this;
    }

    public String getContent() {
        return content;
    }

    public NotificationDO setContent(String content) {
        this.content = content;
        return this;
    }

    public Integer getStatus() {
        return status;
    }

    public NotificationDO setStatus(Integer status) {
        this.status = status;
        return this;
    }

    @Override
    public boolean equals(Object object) {
        if (this == object) return true;
        if (object == null || getClass() != object.getClass()) return false;
        NotificationDO that = (NotificationDO) object;
        return Objects.equals(id, that.id) && Objects.equals(userId, that.userId) && Objects.equals(type, that.type) && Objects.equals(content, that.content) && Objects.equals(status, that.status);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, userId, type, content, status);
    }
}
